import re

s1 = "commit='9a4ee0f7d224efbff75947fa7060daadccc4741c', urls=[https://github.com/golang/protobuf.git, git@github.com:golang/protobuf.git]"

# p = re.compile("commit=(?<=')(.*?)(?=')")
#
# print(p.findall(s1))
# print(p.search(s1).group(1))

commit = re.sub("commit='(.*?)'.*", r"\1", s1, 1)

print(commit)

pu = re.compile("urls=\[(.*)\]")
# urls = re.sub(r"urls=(\[.*\])", r"\1", s1, 1)
urls = pu.findall(s1)
print(urls)
for i in urls:
    print(i)




